<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        /* 
            场景：定义一个PI
                方式一：var PI = 3.1415926
                方式二：const PI = 3.1415926
         */
         var PI = 3.1415926
         console.log(PI)
         PI = 4.1415926  //可以被修改，不符合实际
         console.log(PI)

         //需求：在有时候，要值不可被改变
         const PI1=3.14159
         console.log(PI1)
         PI1 = 4.1      //TypeError: Assignment to constant variable.不能修改const修饰的值
    </script>
</head>
<body>
    
</body>
</html>